import { get, post } from './http'

export const getList = (params) => {
  let url = '/getlists'
  return get(url, params)
}
export const login = (params) => {
  let url = '/authorizations'
  return post(url, params)
}
export const channelList = (params) => {
  let url = '/channels'
  return get(url, params)
}
export const articleList = params => {
  let url = '/mp/articles'
  return get(url, params)
}
export const articleDel = params => {
  let url = `/mp/articles/${params}`
  return delete (url, params)
}
export const articleDetail = params => {
  let url = `/mp/articles/${params}`
  return get(url, params)
}
export const articleAdd = (params) => {
  let url = '/mp/articles?draft=false'
  return post(url, params)
}
export const articleEdit = (params) => {
  let url = `/mp/articles/${params.id}?draft=false`
  return put(url, params)
}

export const getUserInfo = params => {
  let url = '/user/profile'
  return get(url, params)
}

